import java.util.Scanner;

class Point {
private int xPos, yPos;
public Point(int x, int y) {
    xPos = x;
    yPos = y;
    }

@Override
public boolean equals(Object p1) {
    Point p2 = (Point) p1;
    if (this.xPos == p2.xPos && this.yPos == p2.yPos) {
        return true;
    }
    return false;
}
/* 请在这里填写答案 */
}

public class java2_fn6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Object p1 = new Point(sc.nextInt(), sc.nextInt());
        Object p2 = new Point(sc.nextInt(), sc.nextInt());
        System.out.println(p1.equals(p2));
        sc.close();
    }
}